

#include "pencilButton.h"
#include "renderer.h"
#include "input.h"

PencilButton::PencilButton(){

color=Vector4f(0.5,1.0,0.5,1.0);
}
PencilButton::~PencilButton(){}


void PencilButton::setupBasicDrawing(){



//setup grid and connect if we pressed "Shift"
//TODO: make grid toggleAble instead of using the Shift thingy...
        //if (input->bShiftDown)
        //      widge->createGrid();

        //setup drawing
        ParticleSystem *drawing = new ParticleSystem;
        //drawing->bPickable=false;
        drawing->name="drawing";
        drawing->location=input->mouse3D;
        drawing->controller=input->controller;

        drawing->drawType=DRAW_PARTICLES_LINE;
        drawing->sceneShaderID="color";

        //drawing->textureID=renderer->textureList[1];
        drawing->setup();
        renderer->actorList.push_back(drawing);
        //widge->drawing=drawing ;

            if (DrawingWidget::brush)
              {
              DrawingWidget::brush->remove();
              free(DrawingWidget::brush);
              DrawingWidget::brush=NULL;
              }
        DrawingWidget::brush = new Brush;
        DrawingWidget::brush->drawing=drawing;
        DrawingWidget::brush->bPickable=false;
        DrawingWidget::brush->name="brush";
        DrawingWidget::brush->controller=input->controller;

        DrawingWidget::brush->menuType.empty();
        renderer->actorList.push_back(DrawingWidget::brush);

}



void PencilButton::create(){renderer->addButton(this);}
